using System.Collections.Generic;
using System.Linq;
using System.Windows.Browser;
using System.Windows.Controls;

namespace jSLCore.Client.Presentation.BaseControl.Advanced
{
    public static class ControlExtensions
    {
        private static string GetCookie(string key)
        {
            string[] cookies = HtmlPage.Document.Cookies.Split(';');

            foreach (string cookie in cookies)
            {
                string[] keyValue = cookie.Split('=');
                if (keyValue.Length == 2)
                {
                    if (keyValue[0].ToString().Trim() == key)
                        return keyValue[1];
                }
            }
            return null;
        }
    }
}